/**
 * 
 */
package org.jenkon.validator;

/**
 * abstract validator class to validate a object.
 * 
 * @author Jens Konopka
 * 
 * @param <T>
 *            the type to validate
 */
public abstract class AbstractValidator<T> implements Validator<T> {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5122205580542694961L;

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jxcommons.lang.Validator#isValid(java.lang.Object)
	 */
	public boolean isValid(final T value) {
		try {
			validate(value);
		} catch (final Exception e) {
			return false;
		}
		return true;
	}

}
